﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace Luncher
{
    internal class NativeMethods 
    {
        [DllImport("shell32.dll")]
        internal static extern void DragAcceptFiles(IntPtr hWnd, bool fAccept);

        [DllImport("imm32.dll")]
        internal static extern IntPtr ImmAssociateContext(IntPtr handle, IntPtr imeHandle);        
        [DllImport("Imm32.dll")]

        internal static extern IntPtr ImmGetContext(IntPtr hWnd);

        [DllImport("mainapi.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
        internal static extern IntPtr av_ListVMS();//string a = Marshal.PtrToStringAuto(NativeMethods.av_ListVMS());

        [DllImport("mainapi.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
        internal static extern bool av_wProc(IntPtr hwnd, int uMsg, IntPtr wParam);

        [DllImport("mainapi.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
        internal static extern bool av_send_input(string input);

        [DllImport("mainapi.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
        internal static extern int av_Init();

        [DllImport("mainapi.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
        internal static extern int av_CheckVT();

        [DllImport("mainapi.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
        internal static extern void av_KeyEvent(int action);

        [DllImport("mainapi.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
        internal static extern void av_MouseEvent(int action, int x, int y, int type);

        [DllImport("mainapi.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
        internal static extern int av_Lunch(IntPtr hwnd, int x, int y, int clientwidth, int clientheight, string jsonsetting);

        [DllImport("mainapi.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
        internal static extern void av_Screenshot(int x, int y, IntPtr pixels);
      

    }
}
